<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Zend_Service_Amazon_Ec2: Reserved Instances - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/zend.service.amazon.ec2.reserved.instance.html">Inglês (English)</a></li>
    <li><a href="../pt-br/zend.service.amazon.ec2.reserved.instance.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.service.amazon.ec2.windows.instance.html">Zend_Service_Amazon_Ec2: Windows Instances</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.service.html">Zend_Service</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.service.amazon.ec2.cloudwatch.html">Zend_Service_Amazon_Ec2: CloudWatch Monitoring</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="zend.service.amazon.ec2.reserved.instance" class="section"><div class="info"><h1 class="title">Zend_Service_Amazon_Ec2: Reserved Instances</h1></div>
    

    <p class="para">
        With Amazon <acronym class="acronym">EC2</acronym> Reserved Instances, you can make a low one-time payment
        for each instance to reserve and receive a significant discount on the hourly
        usage charge for that instance.
    </p>

    <p class="para">
        Amazon <acronym class="acronym">EC2</acronym> Reserved Instances are based on instance type and location
        (region and Availability Zone) for a specified period of time (e.g.,
        1 year or 3 years) and are only available for Linux or UNIX instances.
    </p>

    <div class="section" id="zend.service.amazon.ec2.reserved.instance.howitworks"><div class="info"><h1 class="title">How Reserved Instances are Applied</h1></div>
        

        <p class="para">
            Reserved Instances are applied to instances that meet the type/location
            criteria during the specified period. In this example, a user is running
            the following instances:
        </p>

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">(4) m1.small instances in Availability Zone us-east-1a</p>
            </li>

            <li class="listitem">
                <p class="para">(4) c1.medium instances in Availability Zone us-east-1b</p>
            </li>

            <li class="listitem">
                <p class="para">(2) c1.xlarge instances in Availability Zone us-east-1b</p>
            </li>
        </ul>

        <p class="para">
            The user then purchases the following Reserved Instances.
        </p>

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">(2) m1.small instances in Availability Zone us-east-1a</p>
            </li>

            <li class="listitem">
                <p class="para">(2) c1.medium instances in Availability Zone us-east-1a</p>
            </li>

            <li class="listitem">
                <p class="para">(2) m1.xlarge instances in Availability Zone us-east-1a</p>
            </li>
        </ul>

        <p class="para">
            Amazon <acronym class="acronym">EC2</acronym> applies the two m1.small Reserved Instances to two of the
            instances in Availability Zone us-east-1a. Amazon <acronym class="acronym">EC2</acronym> doesn&#039;t apply
            the two c1.medium Reserved Instances because the c1.medium instances are in a different
            Availability Zone and does not apply the m1.xlarge Reserved Instances because there are
            no running m1.xlarge instances.
        </p>
    </div>

    <div class="section" id="zend.service.amazon.ec2.reserved.instance.operations"><div class="info"><h1 class="title">Reserved Instances Usage</h1></div>
        

        <div class="example" id="zend.service.amazon.ec2.reserved.instance.operations.describe"><div class="info"><p><b>Example #1 Describes Reserved Instances that you purchased</b></p></div>
            

            <div class="example-contents"><p>
                 <span class="methodname">describeInstances()</span> will return information about a
                reserved instance or instances that you purchased.
            </p></div>

            <div class="example-contents"><p>
                 <span class="methodname">describeInstances()</span> returns a multi-demential array that
                contains reservedInstancesId, instanceType, availabilityZone, duration, fixedPrice,
                usagePrice, productDescription, instanceCount and state.
            </p></div>

            <pre class="programlisting brush: php">
$ec2_instance = new Zend_Service_Amazon_Ec2_Instance_Reserved(&#039;aws_key&#039;,
                                                     &#039;aws_secret_key&#039;);
$return = $ec2_instance-&gt;describeInstances(&#039;instanceId&#039;);
</pre>

        </div>

        <div class="example" id="zend.service.amazon.ec2.reserved.instance.offerings.describe"><div class="info"><p><b>Example #2 Describe current Reserved Instance Offerings available</b></p></div>
            

            <div class="example-contents"><p>
                 <span class="methodname">describeOfferings()</span> Describes Reserved Instance offerings
                that are available for purchase. With Amazon <acronym class="acronym">EC2</acronym> Reserved
                Instances, you purchase the right to launch Amazon <acronym class="acronym">EC2</acronym> instances
                for a period of time (without getting insufficient capacity errors) and pay a lower
                usage rate for the actual time used.
            </p></div>

            <div class="example-contents"><p>
                 <span class="methodname">describeOfferings()</span> returns a multi-demential array that
                contains reservedInstancesId, instanceType, availabilityZone, duration, fixedPrice,
                usagePrice and productDescription.
            </p></div>

            <pre class="programlisting brush: php">
$ec2_instance = new Zend_Service_Amazon_Ec2_Instance_Reserved(&#039;aws_key&#039;,
                                                     &#039;aws_secret_key&#039;);
$return = $ec2_instance-&gt;describeOfferings();
</pre>

        </div>

        <div class="example" id="zend.service.amazon.ec2.reserved.instance.offerings.purchase"><div class="info"><p><b>Example #3 Turn off CloudWatch Monitoring on an Instance(s)</b></p></div>
            

            <div class="example-contents"><p>
                 <span class="methodname">purchaseOffering()</span> Purchases a Reserved Instance for use
                with your account. With Amazon <acronym class="acronym">EC2</acronym> Reserved Instances, you
                purchase the right to launch Amazon <acronym class="acronym">EC2</acronym> instances for a period
                of time (without getting insufficient capacity errors) and pay a lower usage rate
                for the actual time used.
            </p></div>

            <div class="example-contents"><p>
                 <span class="methodname">purchaseOffering()</span> returns the reservedInstanceId.
            </p></div>

            <pre class="programlisting brush: php">
$ec2_instance = new Zend_Service_Amazon_Ec2_Instance_Reserved(&#039;aws_key&#039;,
                                                     &#039;aws_secret_key&#039;);
$return = $ec2_instance-&gt;purchaseOffering(&#039;offeringId&#039;, &#039;instanceCount&#039;);
</pre>

        </div>
    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.service.amazon.ec2.windows.instance.html">Zend_Service_Amazon_Ec2: Windows Instances</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.service.html">Zend_Service</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.service.amazon.ec2.cloudwatch.html">Zend_Service_Amazon_Ec2: CloudWatch Monitoring</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="reference.html">Zend Framework Reference</a></li>
  <li class="header up"><a href="zend.service.html">Zend_Service</a></li>
  <li><a href="zend.service.introduction.html">Introduction</a></li>
  <li><a href="zend.service.akismet.html">Zend_Service_Akismet</a></li>
  <li><a href="zend.service.amazon.html">Zend_Service_Amazon</a></li>
  <li><a href="zend.service.amazon.ec2.html">Zend_Service_Amazon_Ec2</a></li>
  <li><a href="zend.service.amazon.ec2.instance.html">Zend_Service_Amazon_Ec2: Instances</a></li>
  <li><a href="zend.service.amazon.ec2.windows.instance.html">Zend_Service_Amazon_Ec2: Windows Instances</a></li>
  <li class="active"><a href="zend.service.amazon.ec2.reserved.instance.html">Zend_Service_Amazon_Ec2: Reserved Instances</a></li>
  <li><a href="zend.service.amazon.ec2.cloudwatch.html">Zend_Service_Amazon_Ec2: CloudWatch Monitoring</a></li>
  <li><a href="zend.service.amazon.ec2.images.html">Zend_Service_Amazon_Ec2: Amazon Machine Images (AMI)</a></li>
  <li><a href="zend.service.amazon.ec2.ebs.html">Zend_Service_Amazon_Ec2: Elastic Block Storage (EBS)</a></li>
  <li><a href="zend.service.amazon.ec2.elasticip.html">Zend_Service_Amazon_Ec2: Elastic IP Addresses</a></li>
  <li><a href="zend.service.amazon.ec2.keypairs.html">Zend_Service_Amazon_Ec2: Keypairs</a></li>
  <li><a href="zend.service.amazon.ec2.zones.html">Zend_Service_Amazon_Ec2: Regions and Availability Zones</a></li>
  <li><a href="zend.service.amazon.ec2.securitygroups.html">Zend_Service_Amazon_Ec2: Security Groups</a></li>
  <li><a href="zend.service.amazon.s3.html">Zend_Service_Amazon_S3</a></li>
  <li><a href="zend.service.amazon.sqs.html">Zend_Service_Amazon_Sqs</a></li>
  <li><a href="zend.service.audioscrobbler.html">Zend_Service_Audioscrobbler</a></li>
  <li><a href="zend.service.delicious.html">Zend_Service_Delicious</a></li>
  <li><a href="zend.service.developergarden.html">Zend_Service_DeveloperGarden</a></li>
  <li><a href="zend.service.ebay.html">Zend_Service_Ebay</a></li>
  <li><a href="zend.service.ebay.finding.html">Zend_Service_Ebay_Finding</a></li>
  <li><a href="zend.service.flickr.html">Zend_Service_Flickr</a></li>
  <li><a href="zend.service.livedocx.html">Zend_Service_LiveDocx</a></li>
  <li><a href="zend.service.nirvanix.html">Zend_Service_Nirvanix</a></li>
  <li><a href="zend.service.recaptcha.html">Zend_Service_ReCaptcha</a></li>
  <li><a href="zend.service.short-url.html">Zend_Service_ShortUrl</a></li>
  <li><a href="zend.service.simpy.html">Zend_Service_Simpy</a></li>
  <li><a href="zend.service.slideshare.html">Zend_Service_SlideShare</a></li>
  <li><a href="zend.service.strikeiron.html">Zend_Service_StrikeIron</a></li>
  <li><a href="zend.service.strikeiron.bundled-services.html">Zend_Service_StrikeIron: Bundled Services</a></li>
  <li><a href="zend.service.strikeiron.advanced-uses.html">Zend_Service_StrikeIron: Advanced Uses</a></li>
  <li><a href="zend.service.technorati.html">Zend_Service_Technorati</a></li>
  <li><a href="zend.service.twitter.html">Zend_Service_Twitter</a></li>
  <li><a href="zend.service.windowsazure.html">Zend_Service_WindowsAzure</a></li>
  <li><a href="zend.service.windowsazure.storage.blob.html">Zend_Service_WindowsAzure_Storage_Blob</a></li>
  <li><a href="zend.service.windowsazure.diagnostics.manager.html">Zend_Service_WindowsAzure_Diagnostics_Manager</a></li>
  <li><a href="zend.service.windowsazure.storage.queue.html">Zend_Service_WindowsAzure_Storage_Queue</a></li>
  <li><a href="zend.service.windowsazure.storage.table.html">Zend_Service_WindowsAzure_Storage_Table</a></li>
  <li><a href="zend.service.yahoo.html">Zend_Service_Yahoo</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>